package io.github.kuafucv.zero.log.spring.boot.starter.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

@ConfigurationProperties("zero.log")
public class ZeroLogProperties {

    @NestedConfigurationProperty
    private SlowRequest slowRequest = new SlowRequest();

    public SlowRequest getSlowRequest() {
        return slowRequest;
    }

    public void setSlowRequest(SlowRequest slowRequest) {
        this.slowRequest = slowRequest;
    }

    public static class SlowRequest{
        private Boolean enabled = true;
        /**
         * 默认慢请求时间阈值，单位毫秒，默认值 1000
         */
        private int defaultTimeThreshold = 1000;

        public Boolean getEnabled() {
            return enabled;
        }

        public void setEnabled(Boolean enabled) {
            this.enabled = enabled;
        }

        public int getDefaultTimeThreshold() {
            return defaultTimeThreshold;
        }

        public void setDefaultTimeThreshold(int defaultTimeThreshold) {
            this.defaultTimeThreshold = defaultTimeThreshold;
        }
    }
}
